[id].vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <div class="index">
  3. <StoreHeaderCat ref="headercat" @updateFllow="updateFllow"/>
  4. <template v-if="firstLoading && !shutDown && !decorating && !stopBusiness">
  5. <div class="skeleton_banner"></div>
  6. <div class="w_sld_react_1210 adv_04_wrap skeleton">
  7. <div class="floor_title">
  8. <h2>
  9. <font>&nbsp;</font>
  10. <span></span>
  11. <font>&nbsp;</font>
  12. </h2>
  13. </div>
  14. <div class="floor_goods">
  15. <div
  16. class="item"
  17. v-for="(item_main, index_main) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
  18. v-bind:key="index_main"
  19. >
  20. <div class="wrap">
  21. <a href="javascript:void(0)" class="example_text"> </a>
  22. <p class="title">
  23. <a href="javascript:void(0)">{{ item_main }}</a>
  24. </p>
  25. <p class="price"><span></span></p>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </template>
  31. <SldDiy
  32. v-if="!firstLoading && decorateData.data.length"
  33. :decorateData="decorateData"
  34. @adv19="handleAdv19"
  35. />
  36. <!--单独加的荣誉资质-->
  37. <div class="adv_04_wrap honors_wrap self_background" v-show="honors.data.length > 0">
  38. <div class="floor_title">
  39. <h2>
  40. <!-- <font> </font> -->
  41. <span>{{L['荣誉展示']}}</span>
  42. <!-- <font> </font> -->
  43. </h2>
  44. </div>
  45. <div class="floor_goods">
  46. <SliderStore :itemData="honors.data" :itemIndex="0"/>
  47. </div>
  48. </div>
  49. <!-- 空页面 start-->
  50. <SldCommonEmpty
  51. v-if="decorating"
  52. totalHeight="700"
  53. paddingTop="200"
  54. :tip="L['我们正在努力装修中,敬请期待~']"
  55. />
  56. <SldCommonEmpty
  57. v-if="stopBusiness"
  58. totalHeight="700"
  59. paddingTop="200"
  60. :tip="L['店铺暂停经营']"
  61. />
  62. <!-- 空页面 end-->
  63. <SldCommonEmpty
  64. v-if="shutDown"
  65. totalHeight="700"
  66. paddingTop="200"
  67. :tip="L['店铺不存在或已关闭']"
  68. />
  69. </div>
  70. </template>
  71. <script setup>
  72. import { getCurLanguage } from '@/composables/common.js';
  73. const L = getCurLanguage();
  74. const route = useRoute();
  75. const firstLoading = ref(true); //是否第一次加载
  76. const router = useRouter();
  77. const vid = calcProductId(route.path);
  78. const decorateData = reactive({ data: [] }); //装修数据
  79. const shutDown = ref(false);
  80. const decorating = ref(false); //是否装修中
  81. const stopBusiness = ref(false); //是否停业
  82. const honors = reactive({data:[]})
  83. console.log('vid',vid)
  84. const getStoreInfoBaseInfo = async () => {
  85. const {data:value,pending:pending} = await useFetchRaw(apiUrl + 'v3/seller/front/store/detail',{params:{storeId:vid}})
  86. const res = value._rawValue
  87. if(res.state == 200){
  88. honors.data = res.data.storeCertificateList
  89. useHead({
  90. title: res.data.seoInfo.seoTitle,
  91. meta: [
  92. {
  93. name: "description",
  94. content: res.data.seoInfo.seoDesc,
  95. },
  96. {
  97. name: "keywords",
  98. content: res.data.seoInfo.seoKeywords,
  99. },
  100. ],
  101. });
  102. getInitData();
  103. }
  104. else if (res.state == 257) {
  105. shutDown.value = true;
  106. firstLoading.value = false;
  107. } else if (res.state == 270) {
  108. decorating.value = true;
  109. } else if (res.state == 271) {
  110. stopBusiness.value = true;
  111. } else {
  112. ElMessage.error(res.msg);
  113. }
  114. };
  115. getStoreInfoBaseInfo()
  116. const getInitData = async () => {
  117. let param = {
  118. storeId: vid,
  119. };
  120. if (route.query.type == "view" && route.query.decoId){
  121. param.decoId = route.query.decoId;
  122. }
  123. const {data:value,pending:pending} = await useFetchRaw(apiUrl + 'v3/system/front/pcDeco/sellerIndex',{params:param})
  124. const res = value._rawValue
  125. if(!pending._rawValue){
  126. firstLoading.value = false;
  127. }
  128. if (res.state == 200) {
  129. if (res.data) {
  130. if(res.data.data){
  131. decorateData.data = JSON.parse(res.data.data.replace(/&quot;/g, '"'));
  132. decorateData.data.map((item) => {
  133. item.json_data = item.json;
  134. if (item.json_data.type == "adv_19") {
  135. item.json_data.data.map((child) => {
  136. child.cur_tab = 0;
  137. });
  138. }
  139. if (item.json_data && item.json_data.type == "main_banner") {
  140. item.json_data.data = item.json_data.data.filter((i) => i.imgUrl);
  141. }
  142. });
  143. }
  144. } else {
  145. setTimeout(() => {
  146. router.replace({ path: `/store/goods/vid-`+vid });
  147. }, 2000);
  148. }
  149. } else if (res.state == 257) {
  150. shutDown.value = true;
  151. }
  152. };
  153. onMounted(()=>{
  154. setTimeout(() => {
  155. sldStatEvent({ behaviorType: 'spv', storeId: vid ,pageUrl: defaultUrl + router.currentRoute.value.path, referrerPageUrl: apiUrl });
  156. sldStatEvent({ behaviorType: 'pv', storeId: vid,pageUrl: defaultUrl + router.currentRoute.value.path, referrerPageUrl: apiUrl });
  157. }, 3000)
  158. })
  159. </script>
  160. <style lang="scss" scoped>
  161. @import "@/assets/style/decorate.scss";
  162. @import "@/assets/style/theme.scss";
  163. .index {
  164. background: #f8f8f8;
  165. padding-bottom: 10px;
  166. }
  167. .skeleton_banner {
  168. width: 100%;
  169. height: 470px;
  170. background: $colorSkeleton;
  171. margin-bottom: 10px;
  172. }
  173. .skeleton {
  174. &.adv_04_wrap .floor_title h2 span {
  175. background: $colorSkeleton;
  176. display: inline-block;
  177. width: 200px;
  178. }
  179. &.adv_04_wrap .floor_goods .item .wrap .title {
  180. background: $colorSkeleton;
  181. width: 100%;
  182. a {
  183. color: transparent;
  184. }
  185. }
  186. &.adv_04_wrap .floor_goods .item .wrap .price {
  187. width: 100%;
  188. height: 25px;
  189. }
  190. &.adv_04_wrap .floor_goods .item .wrap .price span {
  191. display: inline-block;
  192. width: 70px;
  193. height: 100%;
  194. background: $colorSkeleton;
  195. }
  196. }
  197. .honors_wrap{
  198. min-height: inherit !important;
  199. font-weight: bold;
  200. padding-top: 10px;
  201. font{
  202. top: -5px!important;
  203. }
  204. .floor_title {
  205. // margin-bottom: 0 !important;
  206. width: 1440px;
  207. margin: 0 auto !important;
  208. }
  209. span {
  210. font-weight: bold !important;
  211. }
  212. }
  213. </style>